package zifuchuan;

import utils.Utils;

public class _10回文串 {
    public static void main(String[] args) {
        String init = "abcddcba";
        System.out.println(isPalindrome(init));
        palindrome();
    }

    public static Boolean isPalindrome(String initString) {
        if (initString.length() == 0) {
            return false;
        }
        StringBuilder sb = new StringBuilder(initString);
        if (sb.reverse().toString().equals(initString)) {
            return true;
        }
        return false;
    }

    //输出所有四位数的回文串 ijji
    public static void palindrome() {
        for (int i = 1; i <= 9; i++) {
            for (int j = 0; j <= 9; j++) {
                System.out.println(i * 1000 + j * 100 + j * 10 + i);
            }
        }
    }
}
